package com.hh.releasenode.controller.user;

import com.hh.releasenode.controller.AbstractController;
import com.hh.releasenode.entity.SysUserEntity;
import com.hh.releasenode.form.SysMenuForm;
import com.hh.releasenode.service.SysMenuService;
import com.hh.releasenode.utils.Response;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

/**
 * @ClassName SysMenuController
 * @Description 系统菜单接口
 * @Author KunxianLi
 * Date 2020/6/12 11:09
 * Version 1.0
 **/
@RestController
@Api(tags = "系统菜单接口")
@RequestMapping("/sys/menu")
public class SysMenuController extends AbstractController {

    @Autowired
    private SysMenuService sysMenuService;

    @ApiOperation("添加菜单")
    @PostMapping("/add")
    public Response addMenu(@RequestBody @Validated SysMenuForm sysMenuForm){

        return Response.success();

    }

    @ApiOperation("获取登陆用户导航菜单列表")
    @GetMapping("/nav")
    public Response getMenuList(){
//        Long id = getUser().getId();
        Long userId = 6l;

        return Response.success(sysMenuService.getMenuList(userId));

    }



}
